package nachos.vm;

import nachos.threads.Condition;
import nachos.threads.Lock;

public class PinWaiter {

    private Condition condition;

	private Lock lock;
	
	public PinWaiter() {
		lock = new Lock();
		condition = new Condition(lock);
	}
	
	public void waitForPin() {
		lock.acquire();
		condition.sleep();
		lock.release();
	}
	
	public void releasePin() {
		lock.acquire();
		condition.wake();
		lock.release();
	}
}
